import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import './assets/base.css'

const app = createApp(App)
const pinia = createPinia()
app.use(pinia)

// 等待DOM挂载完成后加载本地存储数据
app.mount('#app')

// 延迟加载本地存储数据，确保store已经初始化
setTimeout(async () => {
  const { useBookStore } = await import('./stores/bookStore')
  const store = useBookStore()
  store.loadFromLocalStorage()
}, 100)
